<?php #//AJAX PHP PENNY AUCTION v.1.1

#///////////////////////////////////////////////////////////
#//  COPYRIGHT 2009 Aaron Helmlinger ALL RIGHTS RESERVED  //
#///////////////////////////////////////////////////////////
////if(!defined("INCLUDED")) exit("Access denied");
                                  

#// Atuomatically login user is necessary ("Remember me" option
if(!isset($_SESSION["PHPAUCTION_LOGGED_IN"]) && isset($_COOKIE['PHPAUCTION_RM_ID'])) {
	$query = "SELECT userid FROM PHPAUCTIONXL_rememberme WHERE hashkey='".addslashes($_COOKIE['PHPAUCTION_RM_ID'])."'";
	$res = mysql_query($query);
	if(!$res){
		MySQLError($query);
		exit;
	}elseif(mysql_num_rows($res) > 0){
		$REMEMBER = mysql_fetch_array(mysql_query("SELECT id,email,nick,name FROM PHPAUCTIONXL_users WHERE id=".intval(mysql_result($res,0,"userid"))));
		mysql_error();
		$_SESSION["PHPAUCTION_LOGGED_IN"] = $REMEMBER['id'];
		$_SESSION["PHPAUCTION_LOGGED_EMAIL"] = $REMEMBER['email']; 
		$_SESSION["PHPAUCTION_LOGGED_NAME"] = $REMEMBER['name'];
		$_SESSION["PHPAUCTION_LOGGED_IN_USERNAME"] = $REMEMBER['nick'];
	}
}

/** *************************************************************************
* NOTE: Modules enbled version
* This version of header.php can be called from any Phpauction XL module
* It uses the $prefix variable to set the correct include path.
*
*
*****************************************************************************/

$prefix = str_replace("http://", "", $prefix);

/* --- Fede 30/04/2008 ------------------------------ */
$prefix = str_replace("http://", "", $prefix);
/*if ( isset($_GET['prefix']) )
    exit ("Access forbidden");

if (file_exists($prefix."includes/ips.inc.php") )
  include $prefix."includes/ips.inc.php";
else
  exit("Access forbidden");  */

/* --- ++ Fede ++ ------------------------------------ */
//-- Function definition section
include $prefix."includes/dates.inc.php";
include $prefix."includes/general_info.inc.php";
include $prefix."maintenance.php";
include $prefix."includes/banners.inc.php";

#//
if(basename($PHP_SELF) != "error.php")
{
	include $prefix."includes/stats.inc.php";
}
// flag to enable style editor
$editstyle=isset($_SESSION["PHPAUCTION_ADMIN_USER"]) && !isset($_GET['thepage']);
$editstyle=$editstyle && $prefix=="";
// Added by Edgar 12/09/2005
// to handle relative paths to themes when browsing webstores
// Seeks path to header.php.html in address of being at home directory or webstores module
if (!isset($SETTINGS['theme']) || empty($SETTINGS['theme'])) $SETTINGS['theme']='default';


if(!$body_tag_onload)   {

        if(!$auction_id) {

$body_tag_onload = "<BODY>";

                     }
                     
                     
                     if($auction_id) {

$body_tag_onload = "<BODY>";

                     }
                            

                             if($auction_id && $NOW2) {

$body_tag_onload = "<BODY onload=\"bidsremaining('$auction_id'); itemPageInfo('$auction_id'); itemPageClock('$auction_id'); ItemCountdownTimer('$NOW2','$ENDS2','0','0');\">";

                     }

                               if($auction_id && $STARTS2) {

$body_tag_onload = "<BODY onload=\"itemPageInfo('$auction_id'); bidsremaining('$auction_id'); UpcomingItemCountdownTimer('$NOW2','$STARTS2','0');\">";

                     }
                     
                                   if($auction_id && $closed == 1) {

$body_tag_onload = "<BODY onload=\"itemPageInfo('$auction_id'); bidsremaining('$auction_id'); ItemCountdownTimerClosed();\">";

                     }

//if($auction_id  && !$NOW2) {$body_tag_onload = "<BODY onload=\"itemPageInfo('$auction_id');\">";}

}



         include(phpa_include("header.php.phone.html"));



?>
